package com.itheima.eurekaprovider.controller;

import entity.Animal;
//import entity.Student;  // 确保 Student 类存在
import org.springframework.web.bind.annotation.*;
import org.springframework.http.ResponseEntity;

@RestController
//@RequestMapping("/hello")
public class HelloController {

    // 接口1：返回字符串
    @RequestMapping("/hello1")
    public String sayHello() {
        return "hello,feign!!!";
    }
    // 接口3：返回 Animal 对象
    @RequestMapping("/hello3")
    public ResponseEntity<Animal> getAnimal() {
        Animal animal = new Animal("狐狸", 4);
        return ResponseEntity.ok(animal);  // 返回单个对象，避免混淆
    }
}